package com.example.myapplication_2.a600_xm.utils;

import com.example.myapplication_2.R;

import java.lang.reflect.Field;



/**
 * Created by Administrator on 2019/3/4.
 */

public class UiUtils {
    public static int getimages(String name) {
        Class drawable = R.drawable.class;
        Field field = null;
        try {
            field = drawable.getField(name);
            int images = field.getInt(field.getName());
            return images;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return 0;
    }


}
